package com.yauthor.module{
	
	public class ResultCountMode{
		
		public static const FLOOR:ResultCountMode = new ResultCountMode("floorMode");
		
		public static const ROUND:ResultCountMode = new ResultCountMode("roundMode");
		
		private var m_modeName:String;
		
		private static const STRING2MODE:Object = {
			"floor": FLOOR,
			"round": ROUND
		}
		
		public function ResultCountMode(name:String){
			m_modeName = name;
		}
		
		public static function decode( mode:String ):ResultCountMode {
			var resultCountMode:ResultCountMode = STRING2MODE[mode];
			if ( resultCountMode==null )
				resultCountMode = FLOOR;
			
			return resultCountMode;
		}
		
		public function toString():String{
			return "[ResultCountMode, mode: " + m_modeName + "]";
		}
	}
}